Skip to content

gh-149296: Add dump subcommand to sampling profiler for one-shot stack snapshots#149297

Merged
pablogsal merged 3 commits intopython:mainfrom
pablogsal:dump
May 4, 2026
Merged

gh-149296: Add dump subcommand to sampling profiler for one-shot stack snapshots#149297
pablogsal merged 3 commits intopython:mainfrom
pablogsal:dump

Conversation

@pablogsal
Copy link
Copy Markdown
Member

@pablogsal pablogsal commented May 2, 2026

Adds python -m profiling.sampling dump <pid>, which prints a single traceback-style snapshot of a running process's Python stack via the existing _remote_debugging unwinder. Supports per-thread status, source line highlighting, optional bytecode opcodes, and async-aware task reconstruction (--async-aware, default --async-mode=all).

@pablogsal pablogsal requested a review from ivonastojanovic May 2, 2026 18:12
@pablogsal pablogsal requested review from AA-Turner and hugovk as code owners May 2, 2026 18:12
@pablogsal pablogsal changed the title gh-149296: Add dump subcommand to sampling profiler for one-shot st… gh-149296: Add dump subcommand to sampling profiler for one-shot stack snapshots May 2, 2026
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 2, 2026

…hot stack snapshots

Adds `python -m profiling.sampling dump <pid>`, which prints a single
traceback-style snapshot of a running process's Python stack via the
existing `_remote_debugging` unwinder. Supports per-thread status,
source line highlighting, optional bytecode opcodes, and async-aware
task reconstruction (`--async-aware`, default `--async-mode=all`).
Copy link
Copy Markdown
Contributor

@ivonastojanovic ivonastojanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks great! Just a couple of small nits

Comment thread Lib/profiling/sampling/dump.py Outdated
Comment thread Doc/library/profiling.sampling.rst Outdated
pablogsal and others added 2 commits May 3, 2026 21:03
Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
@pablogsal pablogsal merged commit 3efd2f4 into python:main May 4, 2026
60 checks passed
@pablogsal pablogsal deleted the dump branch May 4, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants